<template>
  <div>
    <Table border :cols="cols" :data="list">
      <template v-slot:action="{ row: { level } }">
        <el-tag :type="colors[level]">{{levels[level]}}级</el-tag>
      </template>
    </Table>
  </div>
</template>

<script>
import { Rrightlist } from "api/role";
export default {
  name: "users",
  data() {
    return {
      levels: ["一", "二", "三"],
      colors:["","success","warning"],
      cols: [
        {
          title: "#",
          type: "index",
        },
        {
          title: "权限名称",
          name: "authName",
        },
        {
          title: "路径",
          name: "path",
        },
        {
          title: "操作",
          slot: "action",
        },
      ],
    };
  },
  methods: {
    async getRightsList() {
      try {
        this.queryloading = true;
        this.list = await Rrightlist();
      } catch (error) {}
      this.queryloading = false;
    },
  },
  created() {
    this.getRightsList();
  },
};
</script>

<style lang="scss" scoped>
</style>